package mythread.demo001;

public class MyThread12_3 extends Thread {


    @Override
    public void run() {
        super.run();
        try {
            for (int i = 0; i < 500000; i++) {
                if (this.interrupted()) {
                    System.out.println("已经停止！");
                    throw new InterruptedException();//也能是return
                }
                System.out.println("i=" + (i + 1));
            }
            System.out.println("for下面");
        } catch (InterruptedException e) {
            System.out.println("进入thread catch方法");
            e.printStackTrace();
        }
    }
}
